<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!--全部替换 Ctrl + F -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript">
	function selectAll() {
		var allObj = document.getElementById("all");
		var idsObj = document.getElementsByName("id");
		for (var i=0; i<idsObj.length; i++) {
			idsObj[i].checked = allObj.checked;
		}
	}
	
	function go() {
		var page = document.getElementById("page");//第几页元素
		//form1.num.value= page.value; //把第几页值赋值给隐藏元素num
		//form1.submit();//提交表单
		window.location.href='/teacher/?num='+page.value;
	}
</script>
<body>
	<a href="/teacher/goadd">添加</a>
	<form name="form1" action="/teacher/">
		<input type="hident" name="num">
	工号:<input type="text" name="emo_no">
	姓名:<input type="text"  name="name">
	性别:<input type="text"  name="sex">
	<input type="submit" value="查询">
	</form>
	<form action="/teacher/dels">
	<table>
		<tr>
			<td><input type="checkbox" id="all" onclick="selectAll()">全选</td>
			<td>编号</td>
			<td>工号</td>
			<td>姓名</td>
			<td>性别</td>
			<td>出生日期</td>
			<td>学历</td>
			<td>更新时间</td>
			<td>组织名称</td>
			<td>操作</td>
		</tr>
		
		<c:forEach var="t" items="${data}">
			<tr>
			<td><input type="checkbox" name="id" value="${t.id }"></td>
			<td>${t.id }</td>
			<td>${t.emp_no }</td>
			<td>${t.name }</td>
			<td>${t.sex }</td>
			<td>${t.birthday }</td>
			<td>${t.degree}</td>
			<td>${t.update_date }</td>
			<td>${t.org.org_name }</td>
			<td><a href="/teacher/del/${t.id}">删除</a></td>
		</tr>
		</c:forEach>
		
		
	</table>
		<input type="submit" value="批量删除">
	</form>
	<br>
	跳转到第<input type="text" id="page">页 <input type="button" onclick="go()" value="go">
</body>
</html>